package cn.itcast.day03.staticdemo01;
/*
   static:
      1.被static修饰的成员属于类 ,不属于对象
      2.被static修饰的成员优先于对象存在的
      3.被static修饰的成员可以作为共享数据(根据static所在的类创建出来的对象都可以共享这个static的成员)
 */
public class Test {
    public static void main(String[] args) {
        Student.classRoom = "金燕龙202";
        Student student = new Student();
        student.setName("老顽童");
        student.setAge(80);
       /* student.setClassRoom("金燕龙201教室");*/
        System.out.println(student.getName());
        System.out.println(student.getAge());
        //System.out.println(Student.classRoom);
        System.out.println(Student.classRoom);



        Student student1 = new Student();
        student1.setName("杨过");
        student1.setAge(18);
        //student1.setClassRoom("金燕龙201教室");
        System.out.println(student1.getName());
        System.out.println(student1.getAge());
        //System.out.println(Student.classRoom);
        System.out.println(student1.getClassRoom());
    }
}
